function getString() {
    return new Promise((resolve, reject) => {
        setTimeout(() => {
            resolve('hello world after 2s')
        }, 2000)
    })
}

// es6+代码需要babel解析 避免浏览器无法识别
async function helloWorld() {
    let str = await getString()
    console.log(str)
}

export default helloWorld